package cj.web.tb.dao;

import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;
import net.paoding.rose.jade.annotation.SQLParam;
import cj.web.tb.domain.ReportCard;

/**
 * 
 * @author 
 *
 */
@DAO
public interface ReportCardDAO{
	
	@SQL("SELECT * FROM ReportCard WHERE gameId=:t.gameId #if(:t.code!=null){ AND code LIKE '%##(:t.code)%' } #if(:t.name!=null){ AND name LIKE '%##(:t.name)%' } LIMIT :t.start,:t.length ")
    List<ReportCard> query(@SQLParam("t") ReportCard reportCard);
	
	@SQL("SELECT count(1) FROM ReportCard WHERE gameId=:t.gameId #if(:t.code!=null){ AND code LIKE '%##(:t.code)%' } #if(:t.name!=null){ AND name LIKE '%##(:t.name)%' } ")
    int querySize(@SQLParam("t") ReportCard reportCard);
	
    @SQL("SELECT * FROM ReportCard WHERE id=:1")
    ReportCard queryById(int id);
}